package com.dong.user.controller;

import com.dong.user.model.User;
import com.dong.user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author dongjian
 */
@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {
    @Resource
    UserService userService;

    @GetMapping("/{userId}")
    public User getUser(@PathVariable("userId") Long userId,
                        @RequestHeader(value = "Truth", required = false) String truth) {
        log.debug("truth====>{}", truth);
        return userService.getUser(userId);
    }
}
